package com.katze.boot.common.converter;

import com.alibaba.excel.converters.integer.IntegerStringConverter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

public class SexConverter extends IntegerStringConverter {

    @Override
    public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
        switch (value){
            case 0:
                return new WriteCellData<>("男");
            case 1:
                return new WriteCellData<>("女");
            default:
                return new WriteCellData<>("保密");
        }
    }
}
